package com.fenghongzhang.kuaishou.mvp.register.model;


import com.fenghongzhang.kuaishou.common.ShuaiFengServerApi;
import com.fenghongzhang.kuaishou.mvp.login.entity.UserInfoBean;
import com.fenghongzhang.kuaishou.mvp.register.contract.RegisterContract;
import com.fenghongzhang.kuaishou.utils.RetrofitManager;

import io.reactivex.Observable;
import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;


public class RegisterModel implements RegisterContract.IRegisterModel {

    @Override
    public void register(String name, String pwd, Observer<UserInfoBean> observer) {

        RetrofitManager.getInstance().getShuaiFengServerRetrofit()
                .create(ShuaiFengServerApi.class)
                .register(name,pwd)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(observer);

    }

    @Override
    public void destroy() {


    }
}
